// Copyright DustedPixels.com 2008. All rights reserved.

package com.dustedpixels.asm;

import org.objectweb.asm.Opcodes;

/**
 * Utility methods for manipulating access flags.
 * 
 * @author micapolos@gmail.com (Michal Pociecha-Los)
 */
public final class Access {
  /**
   * Returns true if given access flags contains private flag.
   * 
   * @param access access flags
   * @return true if contains private flag
   */
  public static boolean isPrivate(int access) {
    return (access & Opcodes.ACC_PRIVATE) != 0;
  }

  /**
   * Returns true if given access flags contains static flag.
   * 
   * @param access access flags
   * @return true if contains static flag
   */
  public static boolean isStatic(int access) {
    return (access & Opcodes.ACC_STATIC) != 0;
  }

  /**
   * Returns true if given access flags contains final flag.
   * 
   * @param access access flags
   * @return true if contains final flag
   */
  public static boolean isFinal(int access) {
    return (access & Opcodes.ACC_FINAL) != 0;
  }
}
